package com.tengju.data.infrastructure.repository.clickhouse.convert;

import com.tengju.data.domain.model.user.DwdUserRelationMap;
import com.tengju.data.domain.model.user.StarLevelEnum;
import com.tengju.data.domain.model.user.UserIdCode;
import com.tengju.data.infrastructure.persistence.mybatis.dataobject.DwdUserRelationMapDO;

/**
 * @Author: 李大仙
 * @Date: 2021/3/25 12:08 上午
 */
public class DwdUserRelationMapConvert {
    public static DwdUserRelationMap convert(DwdUserRelationMapDO dwdUserRelationMapDO) {
        if (dwdUserRelationMapDO == null) {
            return null;
        }
        return new DwdUserRelationMap(new UserIdCode(dwdUserRelationMapDO.getIdCode()),
                StarLevelEnum.parseByStarLevel(dwdUserRelationMapDO.getStarLevel()));
    }
}
